﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using NDF.Web.Mvc.UI.EasyUI;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Optimization;

namespace NDF.WebClient.Tests
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            //string directory = VirtualPathUtility.GetDirectory("~/Content/bootstrap-theme.css");
            //string aaa = VirtualPathUtility.ToAppRelative(directory);
            //string bbb = VirtualPathUtility.ToAbsolute(directory);
            //Console.WriteLine(aaa);
            //Console.WriteLine(bbb);

            //string virtualPath = "~/Content/bootstrap-theme.css";
            //var a = VirtualPathUtility.IsAbsolute(virtualPath);
            //var b = VirtualPathUtility.IsAppRelative(virtualPath);
            //Console.WriteLine(a);
            //Console.WriteLine(b);

            //BundleTable.Bundles.Add("");
            //Console.WriteLine(VirtualPathUtility.ToAbsolute("/Content/bootstrap-theme.css"));
            //Console.WriteLine(new { A = 1, B = 2, C = 3 }.GetType());

            //Dictionary<string, object> d1 = new Dictionary<string, object>();
            //Dictionary<DateTime, object> d2 = new Dictionary<DateTime, object>();
            //Type t1 = d1.GetType();
            //Type t2 = t1.GetGenericTypeDefinition();
            //Console.WriteLine(t1);
            //Console.WriteLine(t2);
            //Console.WriteLine(t2.GUID);

            //Type t3 = d2.GetType();
            //Type t4 = t3.GetGenericTypeDefinition();
            //Console.WriteLine(t3);
            //Console.WriteLine(t4);
            //Console.WriteLine(t4.GUID);


            //var tagBuilder = new TagBuilder("input");
            //tagBuilder.AddCssClass("easyui-form easyui-validatebox");
            //tagBuilder.AddCssClass("easyui-validatebox");
            //string cls = null;
            //if (tagBuilder.Attributes.TryGetValue("class", out cls))
            //{
            //    Console.WriteLine(tagBuilder.ToString(TagRenderMode.EndTag));
            //    Console.WriteLine(tagBuilder.ToString(TagRenderMode.Normal));
            //    Console.WriteLine(tagBuilder.ToString(TagRenderMode.SelfClosing));
            //    Console.WriteLine(tagBuilder.ToString(TagRenderMode.StartTag));
            //}
            //else
            //{
            //    Console.WriteLine("class attribute is null.");
            //}
        }


        [TestMethod]
        public void TestMethod2()
        {
            //Console.WriteLine(Json.Encode(null));
            //Console.WriteLine(new StringBuilder().Length);
            //Console.WriteLine(new StringBuilder("a").Length);
            //Console.WriteLine(new StringBuilder("abc").Length);

            //var ui = new EasyUiFormControlSetting();
            //ui.Type = EasyUiType.ValidateBox;
            //ui.Value = "abc";
            //Console.WriteLine(ui.ToHtmlString());
        }

        [TestMethod]
        public void TestMethod3()
        {
            
        }
    }



    public class TestClass
    {
        public dynamic Value { get; set; }
    }

}
